Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Multichain): Multichain Safes with same address #4120

Draft
wants to merge 63 commits into
base: dev
Choose a base branch
from

Conversation

schmanu
Copy link
Member

@schmanu schmanu commented Aug 28, 2024

DISCLAIMER

DO NOT MERGE THIS PR BEFORE THE USED CONTRACTS ARE FULLY AUDITED AND OFFICIALLY DEPLOYED

How is this Epic about?

This epic enables users to create Safes with the same address across L1 and L2 networks.
This involves

  • a new Safe creation flow that creates Safes with the correct masterCopy (L1 or L2) during the setup call.
  • a new migration for incompatible L1 Safes on L2 chains
  • design changes to the sidebar to group Safes by address and then by chains
  • a new network selector which allows deploying a opened Safe on a new chain and to switch between deployed chains
  • Action to re-deploy a Safe with the same address

How to test it

See the individual users stories acceptance criteria

Screenshots

tbd

Checklist

  • I've tested the branch on mobile 📱
  • I've documented how it affects the analytics (if at all) 📊
  • I've written a unit/e2e test for it (if applicable) 🧑‍💻

- Sidebar groups Safes with the same address and shows them first.
- New designs for safe groups
Copy link

github-actions bot commented Aug 28, 2024

Copy link

github-actions bot commented Aug 28, 2024

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

Copy link

github-actions bot commented Aug 28, 2024

📦 Next.js Bundle Analysis for safe-wallet-web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 987.26 KB (🟡 +26.16 KB)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Fifteen Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load
/ 511 B (🟢 -24.37 KB) 987.76 KB
/address-book 26.09 KB (🟡 +5 B) 1013.34 KB
/apps/open 53.09 KB (-1 B) 1.02 MB
/balances 29.42 KB (🟢 -1.52 KB) 1016.67 KB
/balances/nfts 19.18 KB (-1 B) 1006.44 KB
/home 57.22 KB (🟢 -923 B) 1.02 MB
/new-safe/advanced-create 36.49 KB (🟡 +1.36 KB) 1023.75 KB
/new-safe/create 35.75 KB (🟡 +1.36 KB) 1023.01 KB
/new-safe/load 16.41 KB (🟡 +6 B) 1003.67 KB
/settings/modules 9.82 KB (🟡 +38 B) 997.08 KB
/settings/notifications 27.03 KB (-2 B) 1014.28 KB
/settings/setup 35.98 KB (🟡 +5 B) 1023.24 KB
/transactions/tx 21.07 KB (-2 B) 1008.33 KB
/welcome 6.8 KB (🟢 -1 B) 994.06 KB
/welcome/accounts 379 B (🟢 -1 B) 987.63 KB
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this.

Copy link

github-actions bot commented Aug 28, 2024

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
77.95% (-0.14% 🔻)
12360/15856
🔴 Branches
58.24% (+0.08% 🔼)
3232/5549
🟡 Functions
65.21% (+0.12% 🔼)
1944/2981
🟡 Lines
79.46% (-0.18% 🔻)
11154/14038
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🟡
... / index.ts
68.97% 100% 50% 73.08%
🟢
... / safeOverviews.ts
100% 100% 100% 100%
🔴
... / ofac.ts
46.43% 0% 25% 54.55%
🟢
... / safePass.ts
90.91% 75% 50% 88.89%
🟢
... / multiChainSafe.ts
92.96% 85.71% 94.74% 96.43%
🟢
... / useSafeCreationData.ts
98.65% 96.15% 100% 100%
🟢
... / useCompatibleNetworks.ts
100% 100% 100% 100%
🔴
... / index.tsx
38.1% 0% 0% 39.02%
🟢
... / MigrateToL2Information.tsx
80% 0% 0% 100%
🔴
... / useAllSafes.ts
50% 17.24% 37.5% 55.56%
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢 src/store/common.ts
88.89% (-11.11% 🔻)
50%
75% (-25% 🔻)
84.62% (-15.38% 🔻)
🟡
... / transaction-guards.ts
68.25% (-1.5% 🔻)
36.11% (-0.81% 🔻)
67.74% (-0.59% 🔻)
69.13% (-1.98% 🔻)
🟡
... / addedSafesSlice.ts
65.52% (+2.36% 🔼)
75% (+25% 🔼)
33.33% (-8.33% 🔻)
68.18% (+0.44% 🔼)
🔴
... / undeployedSafesSlice.ts
38.46% (+1.32% 🔼)
33.33%
30% (-7.5% 🔻)
42.86% (-1.14% 🔻)
🟢
... / deployments.ts
85.48% (-14.52% 🔻)
86.67% (-13.33% 🔻)
81.25% (-18.75% 🔻)
87.23% (-12.77% 🔻)
🟢
... / safeCoreSDK.ts
92.31% (-3.61% 🔻)
84.62% (-7.05% 🔻)
100%
93.48% (-4.2% 🔻)
🟡
... / transaction-calldata.ts
65% (-33.33% 🔻)
0% (-100% 🔻)
54.55% (-45.45% 🔻)
66.67% (-33.33% 🔻)
🔴
... / SafeTxProvider.tsx
28.95% (+0.38% 🔼)
0%
40% (-4.44% 🔻)
29.41% (+0.25% 🔼)
🔴
... / index.tsx
50% (-0.85% 🔻)
3.45% 8.33%
53.06% (-0.94% 🔻)
🟢
... / index.tsx
86.05% (-1.45% 🔻)
37.14% (-1.09% 🔻)
42.86% (-7.14% 🔻)
85.37% (-1.48% 🔻)
🟢
... / index.tsx
100%
62.5% (-4.17% 🔻)
100% 100%
🟢
... / index.tsx
90% (-10% 🔻)
57.14%
50% (-50% 🔻)
88.89% (-11.11% 🔻)
🟢
... / useLoadBalances.ts
91.11% (-2.22% 🔻)
66.67% 100% 95%
🟢
... / utils.ts
92.59% (-7.41% 🔻)
75% (-25% 🔻)
100%
91.67% (-8.33% 🔻)
🟢
... / index.tsx
95.45% (+1.7% 🔼)
76.92% (-4.9% 🔻)
100% 100%
🟢
... / index.ts
94.44% (-1.01% 🔻)
75% (+8.33% 🔼)
100% 100%
🟡
... / index.tsx
72.73% (-10.61% 🔻)
0% 0%
70% (-10% 🔻)
🟡
... / index.tsx
62.22% (-3.85% 🔻)
47.46% (+2.46% 🔼)
58.82% (-2.71% 🔻)
62.7% (-3.34% 🔻)

Test suite run success

1541 tests passing in 205 suites.

Report generated by 🧪jest coverage report action from c8f5406

Copy link

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

@schmanu schmanu changed the title Epic: Multichain Safes with same address [Multichain] Epic: Multichain Safes with same address Sep 9, 2024
Copy link

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

Copy link

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

schmanu and others added 3 commits September 12, 2024 16:29
* feat: SetupToL2 during Safe creation

* feat: use setupToL2 when relaying safe creation

* Feat: add network selector to safe setup

* feat: deploy CF safes on selected networks

* feat: require at least on network to be selected

* fix: creation overview network styles

* Fix: only show wrong chain warning when relevant

* fix: unit tests for ReviewStep and relay creation

* fix: load safe cypress tests

* remove unecessary check in safe creation

* feat: simplify mnemonic safe name

* fix: network multiselector chip styles

* fix: update safe name unit test

* refactor: change multiselector to uncontrolled component with RHF

* fix: remove references to pay later option when it is not available

* feat: exclude xksync from multichain and only offer chains of the same version

* fix: dont allow older safes to be deployed as multichain group

* only allow selecting a single network in the advanced safe creation flow

* fix: check across chains for the next available saltNonce

* fix: wrong chain warning on activation flow

* allow CF deployment for m/n safes

* feat: show success modal on multichain safe creation

* fix: only allow networks with canonical 1.4.1 deployments to be multichain safes

* fix: dismiss CF creation modal in cypress tests

* feat: modify fee info text for multi chain safe creation

* fix: remove unecessary promise.all and account for undefined numberOfOwners in setup hints

* fix: remove unused code and use router.replace for network multi selector

* refactor: move setup contract address to constants.ts

* fix: check chains are compatible with first selected network and wrap multiselector functions in useCallbacl

* fix: remove commented code

---------

Co-authored-by: James Mealy <[email protected]>
…chain safe [SW-150] (#4151)

* feat: add warning when adding or removing an owner to multichain safes

* fix: change owner to signer in text and fix typos

* feat: use current chain name in warning message
Copy link

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

usame-algan and others added 2 commits September 16, 2024 10:22
…-171] (#4163)

* fix: Hide header network selector on non-safe routes

* fix: Failing import export data e2e test

* fix: Move MenuItem component back to be a function and fix e2e test

* fix: Revert NetworkInput refactor

* fix: Failing load_safe e2e test
Copy link

github-actions bot commented Sep 16, 2024

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

schmanu and others added 3 commits September 17, 2024 15:49
…tiaccounts (#4125)

- Redesigns how sub-items are displayed under multi-accounts.
- Adds context menu for multi accounts offering renaming and adding a new network
- Some UX fixes around the context menu
Copy link

github-actions bot commented Sep 17, 2024

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

usame-algan and others added 4 commits September 17, 2024 18:29
…4180)

* fix: Network selector links and visual style

* fix: Update dependency arrays
* fix: Show zksync network but disabled

* fix: Show message if zksync safe is open

* fix: Adjust tests for useReplayableNetworks
usame-algan and others added 29 commits September 24, 2024 14:18
* fix: Adjust chainId inbetween events when creating multichain safe

* fix: Add missing events
…and changing threshold [SW-150] (#4198)

* feat: show signer setup warning for swapping signer or changing threshold.

* feat: move the change signer warning to the relavent block in the confirmation scree
…] [SW-211] (#4243)

* feat: disable renaming multichain sub safes from the context menu

* fix: when removing a CF safe, also remove it from the address book

* feat: remove name input on replay safe modal

* feat: do not show chain indicator when renaming a multichain safe

* refactor: combine upsertAddressBookEntry and upsertMultichainAddressBookEntry

* refactor: simplify upsertAddressBookEntries if-else block
# Conflicts:
#	src/features/counterfactual/ActivateAccountFlow.tsx
* feat: fetch safe overviews using rtk query
* fix: do not load safe overview for undeployed Safes
…4251)

* Feat(Multichain): update text on safe creation review step

* update create button text
…9] (#4262)

* feat: use actual contract addresses from safe-deployments

* pr comments, use typechain

* remove unecessary undefined check for safeToL2SetupInterface
* fix: Adjust multichain design

* fix: Adjust border color
…#4289)

* fix: ignore safe overview requests for empty safe addresses

* refactor: use asError instead of casting

* test: add missing test case

* fix: skip undeployed Safe overviews in network selector
* fix: Check all fallbackHandler deployments

* fix: Add list of networks the twap fallback handler is deployed at and adjust check

* fix: Add tests for twap fallback handler
…SW-240] (#4288)

* feat: add checks for add network feature flag.

* fix: remove condition for 141 to be enabled

* feat: do not show add network option in context menu when feature is disabled

* hide add network button on multichain groups

* feat: hide disabled networks instead of disabling them in the networks selector and network input

* rename feature flag variable for consistency
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants